<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <meta http-equiv="Access-Control-Allow-Origin" content="*">
        <link rel="stylesheet" href="css/ui-btn.css">
        <link rel="stylesheet" href="css/ui-res.css">
        <link rel="stylesheet" href="css/ui-fold.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <script src="js/zy/zy_control.js">
        </script>
        <script src="js/zy/zy_click.js">
        </script>
        <script src="js/common/system_config.js">
        </script>
        <script src="js/common/jquery-1.7.min.js">
        </script>
    </head>
    <body class="um-vp" ontouchstart>
        <!--可折叠区域开始-->
        <div class="uba b-gra uc-a1 umar-b">
            <div ontouchstart="zy_touch('btn-act')" onclick="zy_for(event,zy_fold);" class="uc-a1 t-bla ub uinn ub-ac c-m2 c-gra col ulev umh4">
                <div class="ub-f1 ut-s">
                    折扣图片
                </div>
                <div class="umh1 umw1">
                </div>
            </div>
            <div class="t-bla   c-wh  " id="zkpic">
            </div>
        </div>
        <!--可折叠区域结束-->
        <!--可折叠区域开始-->
        <div class="uba b-gra uc-a1 umar-b">
            <div ontouchstart="zy_touch('btn-act')" onclick="zy_for(event,zy_fold);" class="uc-a1 t-bla ub uinn ub-ac c-m2 c-gra col ulev umh4">
                <div class="ub-f1 ut-s">
                    详细介绍
                </div>
                <div class="umh1 umw1">
                </div>
            </div>
            <div class="uinn umh6 t-bla c-wh  " id="xxjs">
            </div>
        </div>
        <!--可折叠区域结束-->
        <!--可折叠区域开始-->
        <div class="uba b-gra uc-a1 umar-b">
            <div ontouchstart="zy_touch('btn-act')" onclick="zy_for(event,zy_fold);" class="uc-a1 t-bla ub uinn ub-ac c-m2 c-gra col ulev umh4">
                <div class="ub-f1 ut-s">
                    商家介绍
                </div>
                <div class="umh1 umw1">
                </div>
            </div>
            <div class="uinn umh6 t-bla   c-wh  " id="sjjs">
            </div>
        </div>
        <!--可折叠区域结束-->
        <!--可折叠区域开始-->
        <div class="uba b-gra uc-a1 umar-b">
            <div ontouchstart="zy_touch('btn-act')" onclick="zy_for(event,zy_fold);" class="uc-a1 t-bla ub uinn ub-ac c-m2 c-gra col ulev umh4">
                <div class="ub-f1 ut-s">
                    商家地址
                </div>
                <div class="umh1 umw1">
                </div>
            </div>
            <div class="uinn umh6 t-bla   c-wh  " id="sjdz">
            </div>
        </div>
        <!--可折叠区域结束-->
        <!--可折叠区域开始-->
        <div class="uba b-gra uc-a1 umar-b">
            <div ontouchstart="zy_touch('btn-act')" onclick="zy_for(event,zy_fold);" class="uc-a1 t-bla ub uinn ub-ac c-m2 c-gra col ulev umh4">
                <div class="ub-f1 ut-s">
                    联系方式
                </div>
                <div class="umh1 umw1" id="sjdz">
                </div>
            </div>
            <div class="uinn umh6 t-bla   c-wh  " id="sjlxfs">
            </div>
        </div>
        <!--可折叠区域结束-->
        <!--可折叠区域开始-->
        <div class="uba b-gra uc-a1 umar-b">
            <div ontouchstart="zy_touch('btn-act')" onclick="zy_for(event,zy_fold);" class="uc-a1 t-bla ub uinn ub-ac c-m2 c-gra col ulev umh4">
                <div class="ub-f1 ut-s">
                    有效时间
                </div>
                <div class="umh1 umw1">
                </div>
            </div>
            <div class="uinn umh6 t-bla   c-wh  " id="dateRange">
            </div>
        </div>
        <!--可折叠区域结束-->
        <!--块容器开始-->
        <div class="ub   c-wh c-m1 t-wh uc-a1 ">
            <div class="ubr  ub-f1 uinn uc-l1">
                <!--按钮开始-->
                <div ontouchstart="zy_touch('btn-act')" onclick="uexWindow.alert('提示','收藏成功,已加入到收藏夹..','确认');" class="btn uba b-bla uinn5 c-org1 c-m9 uc-a1 t-bla">
                    收　　藏
                </div>
                <!--按钮结束-->
            </div>
            <div class="ubr  ub-f1 uinn ">
                　　　　 
            </div>
            <div class="ub-f1 uinn uc-r1">
                <!--按钮开始-->
                <div ontouchstart="zy_touch('btn-act')" onclick="haoping()" class="btn uba b-bla uinn5 c-org1 c-m9 uc-a1 t-bla">
                    赞
                </div>
                <!--按钮结束-->
            </div>
        </div>
        <!--块容器结束-->
    </body>
    <script>
        zy_init();
        var flag = 0;
        var jApp = $.noConflict(true);
        window.uexOnload = function(type){
            if (!type) {
                init();
                uexWindow.setBounce("1");
                uexWindow.showBounceView("0", "#FFF", "0");
                uexWindow.showBounceView("1", "#FFF", "0");
            }
            function init(){
                var nowDisId = localStorage["nowDisId"];
                uexWindow.toast(1, 5, '正在获取信息列表...', 0);
                var getDiscountsUrl = SysConfig.serverPath + 'discountsJson/queryDiscounts.action?' +
                'id=' +
                nowDisId;
                jApp.getJSON(getDiscountsUrl, getDiscountsSuccess, 'json', function(err){
                    alert(err);
                }, 'POST', false);
            }
            
            function getDiscountsSuccess(data){
                if (data[0].responseState == 1) {
                    uexWindow.alert('错误', data[0].responsePrompt, '确定');
                }
                createDiscounts(data[0].responseData);
                uexWindow.closeToast();
            }
            function createDiscounts(discounts){
                jApp("#sjdz").text(discounts.address);
                ;
                jApp("#sjlxfs").text(discounts.contact);
                ;
                jApp("#sjjs").text(discounts.disp);
                ;
                if (discounts.imgsrc != "") 
                    jApp("#zkpic").append('<img src=' + discounts.imgsrc + ' />');
                jApp("#xxjs").text(discounts.goods);
                ;
                jApp("#dateRange").text(discounts.begintime + "　至　" + discounts.endtime);
                ;
            }
        }
        
        function haoping(){
            if (flag == 0) {
            
                uexWindow.toast(1, 5, '正在获取信息列表...', 0);
				var nowDisId = localStorage["nowDisId"];
                var updateApprovalUrl = SysConfig.serverPath + 'discountsJson/updateApproval.action?id='+nowDisId;
                jApp.getJSON(updateApprovalUrl, updateApprovalSuccess, 'json', function(err){
                    alert(err);
                }, 'POST', false);
                flag = 1;
            }
            else {
            	uexWindow.alert('消息', '请不要重复评价!', '确定');
            }
        }
        
        function updateApprovalSuccess(){
            uexWindow.closeToast();
            uexWindow.alert('消息', '评价成功!', '确定');
        }
        
        //方法
        
        
        function formartDate(dataFormate, time){
            var date = new Date();
            date.setTime(time);
            return date.pattern(dataFormate);
        }
        
        Date.prototype.pattern = function(fmt){
            var o = {
                "M+": this.getMonth() + 1, //月份     
                "d+": this.getDate(), //日     
                "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时     
                "H+": this.getHours(), //小时     
                "m+": this.getMinutes(), //分     
                "s+": this.getSeconds(), //秒     
                "q+": Math.floor((this.getMonth() + 3) / 3), //季度     
                "S": this.getMilliseconds()
                //毫秒     
            };
            var week = {
                "0": "日",
                "1": "一",
                "2": "二",
                "3": "三",
                "4": "四",
                "5": "五",
                "6": "六"
            };
            if (/(y+)/.test(fmt)) {
                fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            }
            if (/(E+)/.test(fmt)) {
                fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "星期" : "周") : "") +
                week[this.getDay() + ""]);
            }
            if (/(e+)/.test(fmt)) {
                fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "星期" : "周") : "") +
                this.getDay());
            }
            for (var k in o) {
                if (new RegExp("(" + k + ")").test(fmt)) {
                    fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
                }
            }
            return fmt;
        }
    </script>
</html>
